package com.devilvan.betrice.lol.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.devilvan.betrice.common.BasePo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serial;
import java.io.Serializable;

/**
 * @author Evad.Wu
 * @Description LOL-对局队伍信息 映射
 * @date 2022-09-30
 */
@Setter
@Getter
@ToString(exclude = {"lolBattleHeaderPo"})
@NoArgsConstructor
@Accessors(chain = true)
@TableName(value = "LOL_BATTLE_TEAM")

@Entity
@Table(name = "LOL_BATTLE_TEAM")
@DynamicInsert
@EntityListeners(AuditingEntityListener.class)
@Schema(description = "LOL-对局队伍信息 映射")
public class LolBattleTeamPo extends BasePo implements Serializable {
    @Serial
    private static final long serialVersionUID = -7686285033818000392L;
    @Schema(description = "对局ID")
    @TableField(value = "GAME_ID")
    @Column(name = "GAME_ID", columnDefinition = "BIGINT(19) NOT NULL COMMENT '对局ID'")
    private Long gameId;
    @Schema(description = "100-左下角蓝色方, 200-右上角红色方")
    @TableField(value = "TEAM")
    @Column(name = "TEAM", columnDefinition = "VARCHAR(8) COMMENT '蓝色方/红色方'")
    private String team;
    @Schema(description = "1号ban位")
    @TableField(value = "BAN1")
    @Column(name = "BAN1", columnDefinition = "INT(10) COMMENT '1号ban位'")
    private Integer ban1;
    @Schema(description = "2号ban位")
    @TableField(value = "BAN2")
    @Column(name = "BAN2", columnDefinition = "INT(10) COMMENT '2号ban位'")
    private Integer ban2;
    @Schema(description = "3号ban位")
    @TableField(value = "BAN3")
    @Column(name = "BAN3", columnDefinition = "INT(10) COMMENT '3号ban位'")
    private Integer ban3;
    @Schema(description = "4号ban位")
    @TableField(value = "BAN4")
    @Column(name = "BAN4", columnDefinition = "INT(10) COMMENT '4号ban位'")
    private Integer ban4;
    @Schema(description = "5号ban位")
    @TableField(value = "BAN5")
    @Column(name = "BAN5", columnDefinition = "INT(10) COMMENT '5号ban位'")
    private Integer ban5;
    @Schema(description = "团队ELO")
    @TableField(value = "TEAM_ELO")
    @Column(name = "TEAM_ELO", columnDefinition = "INT(10) COMMENT '团队ELO'")
    private Integer teamElo;
    @Schema(description = "队伍总击杀数")
    @TableField(value = "TOTAL_KILLS")
    @Column(name = "TOTAL_KILLS", columnDefinition = "INT(10) COMMENT '队伍总击杀数'")
    private Integer totalKills;
    @Schema(description = "队伍总助攻数")
    @TableField(value = "TOTAL_ASSISTS")
    @Column(name = "TOTAL_ASSISTS", columnDefinition = "INT(10) COMMENT '队伍总助攻数'")
    private Integer totalAssists;
    @Schema(description = "队伍总死亡数")
    @TableField(value = "TOTAL_DEATHS")
    @Column(name = "TOTAL_DEATHS", columnDefinition = "INT(10) COMMENT '队伍总死亡数'")
    private Integer totalDeaths;
    @Schema(description = "队伍击杀大龙数")
    @TableField(value = "TOTAL_BARON_KILLS")
    @Column(name = "TOTAL_BARON_KILLS", columnDefinition = "INT(10) COMMENT '队伍击杀大龙数'")
    private Integer totalBaronKills;
    @Schema(description = "是否摧毁大本营数")
    @TableField(value = "TOTAL_BASE_KILLED")
    @Column(name = "TOTAL_BASE_KILLED", columnDefinition = "BIT(1) COMMENT '是否摧毁大本营数'")
    private Boolean totalBaseKilled;
    @Schema(description = "队伍击杀峡谷先锋数")
    @TableField(value = "TOTAL_DAMPEN_KILLED")
    @Column(name = "TOTAL_DAMPEN_KILLED", columnDefinition = "INT(10) COMMENT '队伍击杀峡谷先锋数'")
    private Integer totalDampenKilled;
    @Schema(description = "队伍击杀小龙数")
    @TableField(value = "TOTAL_DRAGON_KILLS")
    @Column(name = "TOTAL_DRAGON_KILLS", columnDefinition = "INT(10) COMMENT '队伍击杀小龙数'")
    private Integer totalDragonKills;
    @Schema(description = "队伍总金币数")
    @TableField(value = "TOTAL_GOLD_EARNED")
    @Column(name = "TOTAL_GOLD_EARNED", columnDefinition = "INT(10) COMMENT '队伍总金币数'")
    private Integer totalGoldEarned;
    @Schema(description = "队伍总推塔数")
    @TableField(value = "TOTAL_TURRETS_KILLED")
    @Column(name = "TOTAL_TURRETS_KILLED", columnDefinition = "INT(10) COMMENT '队伍总推塔数'")
    private Integer totalTurretsKilled;
    @Schema(description = "是否投降")
    @TableField(value = "IS_SURRENDER")
    @Column(name = "IS_SURRENDER", columnDefinition = "BIT(1) COMMENT '是否投降'")
    private Boolean isSurrender;
    @Schema(description = "是否获得游戏胜利")
    @TableField(value = "WIN")
    @Column(name = "WIN", columnDefinition = "BIT(1) COMMENT '是否获得游戏胜利'")
    private Boolean win;

    @Schema(description = "对局基本信息")
    @TableField(exist = false)
    @ManyToOne(targetEntity = LolBattleHeaderPo.class, cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    @JoinColumn(name = "GAME_ID", referencedColumnName = "GAME_ID", insertable = false, updatable = false)
    private LolBattleHeaderPo lolBattleHeaderPo;
}
